Skip to content

Initial commit for task end points #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

bluepal-prasanthi-moparthi
Copy link
Collaborator

This PR includes the implementation and test cases for the following task-related endpoints:

  • List all tasks

  • Get a specific task

  • Create a new task

  • Create a task with a specific ID

  • Remove a task

Copy link

cla-bot bot commented Jul 9, 2025

Fresh avocado detected! Welcome and thank you for your contribution @bluepal-prasanthi-moparthi. My avocado-loving overlords have decreed a signed CLA is required for PRs. Please see https://github.com/arangodb/arangodb/blob/devel/CONTRIBUTING.md file to learn more or ask cla(at)arangodb.com if you have issues.

@fceller
Copy link
Contributor

fceller commented Jul 14, 2025

please rerun test

@jwierzbo jwierzbo requested a review from Copilot July 14, 2025 10:31
Copilot

This comment was marked as outdated.

@jwierzbo jwierzbo requested a review from Copilot July 17, 2025 11:45
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements task management endpoints for ArangoDB v2, adding the ability to create, list, retrieve, and delete tasks through the Go driver. It introduces comprehensive task API functionality with proper validation, error handling, and test coverage.

  • Complete task management API implementation including CRUD operations
  • Comprehensive test coverage with positive and negative test cases
  • Integration with the existing client structure through interface composition

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
v2/arangodb/tasks.go Defines ClientTasks interface, TaskOptions struct, and Task interface for task management
v2/arangodb/tasks_impl.go Implements task management functionality with HTTP API calls and response handling
v2/arangodb/client.go Adds ClientTasks interface to the main Client interface
v2/arangodb/client_impl.go Integrates clientTask into the client struct and initialization
v2/tests/tasks_test.go Comprehensive test suite covering task creation, validation, and operations
Comments suppressed due to low confidence (7)

v2/tests/tasks_test.go:41

  • The task name 'taskWIthParams' contains inconsistent capitalization. Should be 'taskWithParams'.
			"taskWIthParams": {

v2/tests/tasks_test.go:42

  • The task name 'taskWIthParams' contains inconsistent capitalization. Should be 'taskWithParams'.
				Name:    utils.NewType("taskWIthParams"),

v2/tests/tasks_test.go:49

  • The task name 'taskWIthOutParams' contains inconsistent capitalization. Should be 'taskWithoutParams'.
			"taskWIthOutParams": {

v2/tests/tasks_test.go:50

  • The task name 'taskWIthOutParams' contains inconsistent capitalization. Should be 'taskWithoutParams'.
				Name:    utils.NewType("taskWIthOutParams"),

v2/tests/tasks_test.go:111

  • The task name 'taskWIthOutCommand' contains inconsistent capitalization. Should be 'taskWithoutCommand'.
			"taskWIthOutCommand": {

v2/tests/tasks_test.go:112

  • The task name 'taskWIthOutCommand' contains inconsistent capitalization. Should be 'taskWithoutCommand'.
				Name:   utils.NewType("taskWIthOutCommand"),

v2/tests/tasks_test.go:115

  • The task name 'taskWIthOutPeriod' contains inconsistent capitalization. Should be 'taskWithoutPeriod'.
			"taskWIthOutPeriod": nil,

}

// Tasks retrieves all tasks from the specified database.
// Retuns a slice of Task objects representing the tasks in the database.
Copy link
Preview

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: 'Retuns' should be 'Returns'.

Suggested change
// Retuns a slice of Task objects representing the tasks in the database.
// Returns a slice of Task objects representing the tasks in the database.

Copilot uses AI. Check for mistakes.

Name string `json:"name,omitempty"`
Command string `json:"command,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
Period int64 `json:"period,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use pointers

id string
name string
command string
params json.RawMessage
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use pointers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants